package cn.spring.ly.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;

import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author ly
 * @since 2018-12-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Category extends Model<Category> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 分类名称
     */
    private String name;

    /**
     * 分类父id 
     */
    private Integer parentId;

    /**
     * banner图
     */
    private String bannerUrl;

    /**
     * 分类图标
     */
    private String iconUrl;

    /**
     * 是否删除
     */
    @TableLogic
    private Boolean isDelete;
    
    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String PARENT_ID = "parent_id";

    public static final String BANNER_URL = "banner_url";

    public static final String ICON_URL = "icon_url";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
